package com.vogue.supplymall.common.domain.dto;

import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 商品、店铺查询时接收前端post信息的类
 *
 * @Aouthor: zhangliang
 * @Date: Create in 2017-12-05
 */
public class SearchInfo implements Serializable {

    /**
     * 进店看看>店铺id
     */
    private Long id;
    /**
     * syscodeid
     */
    private Long syscodeid;
    /**
     * session id
     */
    private String sessionId;
    /**
     * 位置代码 默认值北京
     */
    private String position = "110100";
    /**
     * 检索内容
     */
    private String content;
    /**
     * 价格区间的低价
     */
    private String priceUp;
    /**
     * 价格区间的高价
     */
    private String priceDown;
    /**
     * 检索类别代码
     */
    private String categoryCode;

    private String[] categorys;
    /**
     * 检索显示有无库存 0:全部 1:有货
     */
    private Integer inventoryFlag = 0;
    /**
     * 服务 0：全部 1：可配送 2：同城
     */
    private Integer areaFlag = 1;
    /**
     * limit开始位置
     */
    private Integer start = 0;
    /**
     * limit结束位置
     */
    private Integer length = 10;
    /**
     * 排序的key 1：销量 2：价格 3：名称 4：评价
     */
    private Integer orderKey = 0;
    /**
     * 排序顺序 1：由低到高 asc 2：由高到低 desc
     */
    private Integer order = 0;
    /**
     * 区域省市
     * key:1：全国 2：全区域 4：全省 8：全市
     */
    private Map<String, String> positions = new HashMap<String, String>();
    /**
     * 排序
     */
    private String orderBy;
    /**
     * 登录id
     * 2018/3/30
     */
    private Long loginId;
    private Integer type;
    /**
     * 目标对象类型 1:用户 2:商品 3:店铺
     */
    private Integer targetObjType;
    /**
     * 补充字段，用于传递参数
     * @param categoryCode
     */
    private String paramCol;

    /**
     * 私有化平台Id
     */
    private Long tendId;

    private void transformCategorycode(String categoryCode) {
        if (StringUtils.isEmpty(categoryCode)) setCategorys(new String[]{});
        if (categoryCode.contains(",")) {
            setCategorys(categoryCode.split(","));
        }
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSyscodeid() {
        return syscodeid;
    }

    public void setSyscodeid(Long syscodeid) {
        this.syscodeid = syscodeid;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getPriceUp() {
        return priceUp;
    }

    public void setPriceUp(String priceUp) {
        this.priceUp = priceUp;
    }

    public String getPriceDown() {
        return priceDown;
    }

    public void setPriceDown(String priceDown) {
        this.priceDown = priceDown;
    }

    public String getCategoryCode() {
        return categoryCode;
    }

    public void setCategoryCode(String categoryCode) {
        this.categoryCode = categoryCode;
    }

    public Integer getInventoryFlag() {
        return inventoryFlag;
    }

    public void setInventoryFlag(Integer inventoryFlag) {
        this.inventoryFlag = inventoryFlag;
    }

    public Integer getAreaFlag() {
        return areaFlag;
    }

    public void setAreaFlag(Integer areaFlag) {
        this.areaFlag = areaFlag;
    }

    public Integer getStart() {
        return start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public Map<String, String> getPositions() {
        return positions;
    }

    public void setPositions(Map<String, String> positions) {
        this.positions = positions;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public Integer getOrderKey() {
        return orderKey;
    }

    public void setOrderKey(Integer orderKey) {
        this.orderKey = orderKey;
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    public String[] getCategorys() {
        return categorys;
    }

    public void setCategorys(String[] categorys) {
        this.categorys = categorys;
    }

    public Long getLoginId() {
        return loginId;
    }

    public void setLoginId(Long loginId) {
        this.loginId = loginId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getTargetObjType() {
        return targetObjType;
    }

    public void setTargetObjType(Integer targetObjType) {
        this.targetObjType = targetObjType;
    }

	public String getParamCol() {
		return paramCol;
	}

	public void setParamCol(String paramCol) {
		this.paramCol = paramCol;
	}

    public Long getTendId() {
        return tendId;
    }

    public void setTendId(Long tendId) {
        this.tendId = tendId;
    }
}
